'''
Created on Dec 5, 2011

@author: ibrahimelfar
'''

from itertools import product, chain

class EclipseGenerator:
    def __init__(self, context, template_name, template, tags):
        self.context = context
        
    def Generate(self):
        pass
    
class Tags:
    tags = ['html', 'body']

    eclipse_context = 'html_all'
    eclipse_template_name = '{0}-tag-eclipse-listen'
    eclipse_template = '<{0}>${{cursor}}</{0}>'
    
    def Generate(self):
        for t in self.tags:
            
            print self.eclipse_template.format(tag = t)

class Commands:
    directions = ['this', 'current', 'next', 'previous',]
    units = chain.from_iterable([[w, w + 's'] for w in ['word', 'line']])
    counts = [''] + [str(x) for x in range(1, 10)]
    application = 'eclipse'
    state = ''
    def Generate(self):
        combinations = filter(lambda x: (x[0] in ['this', 'current'] or x[1] in ['', '1']) ^ x[2].endswith('s'),
                              product(self.directions, self.counts, self.units))
        for k in combinations:
            print k
        return []


print Tags().Generate()
    
selection = {
         'select {this_synonyms} line': [],
         'select previous line': [],
         'select next line': [],

         'select next {number} lines': [],
         'select previous {number} lines': [],

         'select this word': [],
         'select next {number} words': [],
         'select previous {number} words': [],

         '': [],
         '': [],
         '': [],
         '': [],
         '': [],
         }

navigation = {
         '[go to] next|previous word|sentence|line|method|class': [],
         '': [],
         '': [],
         '': [],
         '': [],
         '': [],
         '': [],
         '': [], 

             }


editing = {
         'comment|uncomment': [],
         '': [],
         '': [],
         '': [],

           }